package PlanUI;

import java.rmi.RemoteException;

import javax.swing.JComboBox;
import javax.swing.JPanel;

import vo.PlanVO;
import vo.TeacherVO;

import PlanBL.PlanLogicService;
import RMI.RMIHelper;
import SelectLessonBL.SelectLessonLogicService;
import StructureUI.StructureDetail;

public class AcdManagePlan extends JPanel
{	
	PlanDetail pd;
	StructureDetail sd;
	TeacherVO user;
	
	public AcdManagePlan(TeacherVO tv)
	{
		setSize(1280,725*4/5);
		setVisible(true);
		setLayout(null);
		setOpaque(false);
		
		pd= new PlanDetail();
		pd.setBounds(480, 0, 768, 725*4/5);		
		
		sd=new StructureDetail();
		sd.setBounds(0, 0, 480, 725*4/5);
		
		add(pd);
		add(sd);
		
		user = tv;
		init();
			
	}
	
	private void init()
	{
		RMIHelper rmi = new RMIHelper();
		PlanLogicService pls = rmi.getPlanService();
		try
		{
			PlanVO aim =pls.getPlan(user.department);
			pd.showPlan(aim);
		} catch (RemoteException e)
		{
			e.printStackTrace();
		}	
		pd.department.setText(user.department);
		pd.department.setEditable(false);
		
		sd.setUnchange();
	}
	
}
